calculus of variations engineering mathematics